/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "customertransaction")
@XmlRootElement(name="customertransaction")
@NamedQueries({
    @NamedQuery(name = "Customertransaction.findAll", query = "SELECT c FROM Customertransaction c"),
    @NamedQuery(name = "Customertransaction.findByCustomertransactionID", query = "SELECT c FROM Customertransaction c WHERE c.customertransactionID = :customertransactionID"),
    @NamedQuery(name = "Customertransaction.findByDescription", query = "SELECT c FROM Customertransaction c WHERE c.description = :description"),
    @NamedQuery(name = "Customertransaction.findByAmount", query = "SELECT c FROM Customertransaction c WHERE c.amount = :amount"),
    @NamedQuery(name = "Customertransaction.findByIsdeleted", query = "SELECT c FROM Customertransaction c WHERE c.isdeleted = :isdeleted")})
public class Customertransaction implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "CustomertransactionID")
    private Long customertransactionID;
    @Column(name = "description")
    private String description;
    @Column(name = "amount")
    private Double amount;
    @Column(name = "isdeleted")
    private Short isdeleted;
    @JoinColumn(name = "Tax_TaxID", referencedColumnName = "TaxID")
    @ManyToOne(optional = false)
    private Tax tax;
    @JoinColumn(name = "promotionaloffer_PromotionalofferID", referencedColumnName = "PromotionalofferID")
    @ManyToOne
    private Promotionaloffer promotionaloffer;
    @JoinColumn(name = "person_PersonID", referencedColumnName = "PersonID")
    @ManyToOne(optional = false)
    private Person person;
    @JoinColumn(name = "paymentmode_PaymentmodeID", referencedColumnName = "PaymentmodeID")
    @ManyToOne(optional = false)
    private Paymentmode paymentmode;
    @JoinColumn(name = "discountype_DiscounttypeID", referencedColumnName = "DiscounttypeID")
    @ManyToOne
    private Discountype discountype;
    @JoinColumn(name = "currencytype_CurrencyTypeID", referencedColumnName = "CurrencyTypeID")
    @ManyToOne(optional = false)
    private Currencytype currencytype;
    @JoinColumn(name = "transactiontype_TransactiontypeID", referencedColumnName = "TransactiontypeID")
    @ManyToOne
    private Transactiontype transactiontype;

    public Customertransaction() {
    }

    public Customertransaction(Long customertransactionID) {
        this.customertransactionID = customertransactionID;
    }

    public Long getCustomertransactionID() {
        return customertransactionID;
    }

    public void setCustomertransactionID(Long customertransactionID) {
        this.customertransactionID = customertransactionID;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Short getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Short isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Tax getTax() {
        return tax;
    }

    public void setTax(Tax tax) {
        this.tax = tax;
    }

    public Promotionaloffer getPromotionaloffer() {
        return promotionaloffer;
    }

    public void setPromotionaloffer(Promotionaloffer promotionaloffer) {
        this.promotionaloffer = promotionaloffer;
    }

    public Person getPerson() {
        return person;
    }

    public void setPerson(Person person) {
        this.person = person;
    }

    public Paymentmode getPaymentmode() {
        return paymentmode;
    }

    public void setPaymentmode(Paymentmode paymentmode) {
        this.paymentmode = paymentmode;
    }

    public Discountype getDiscountype() {
        return discountype;
    }

    public void setDiscountype(Discountype discountype) {
        this.discountype = discountype;
    }

    public Currencytype getCurrencytype() {
        return currencytype;
    }

    public void setCurrencytype(Currencytype currencytype) {
        this.currencytype = currencytype;
    }

    public Transactiontype getTransactiontype() {
        return transactiontype;
    }

    public void setTransactiontype(Transactiontype transactiontype) {
        this.transactiontype = transactiontype;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (customertransactionID != null ? customertransactionID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Customertransaction)) {
            return false;
        }
        Customertransaction other = (Customertransaction) object;
        if ((this.customertransactionID == null && other.customertransactionID != null) || (this.customertransactionID != null && !this.customertransactionID.equals(other.customertransactionID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Customertransaction[customertransactionID=" + customertransactionID + "]";
    }

}
